#include "Ball.h"
#include "GeomBuilder.h"
#include "TranslateNode.h"
#include "RotationNode.h"
#include <iostream>

Ball::Ball(float r, Location l) : size(1), loc(l), drawMe(true) {
	SceneNode *transNode = new TranslateNode(loc);
	// SceneNode *rotNode = new RotationNode(new D3DXVECTOR3(1.0, 0.0, 0.0), .5);
	
	//rotNode->AddChild(BuildCylinder(0, r, 8));

	//transNode->AddChild(rotNode);
	transNode->AddChild(BuildCylinder(.5, r, 8));
	root.AddChild(transNode);
}

Ball::~Ball(void) {
	std::cout << "Deleting ball.\n";
}

SceneRoot* Ball::getDrawables(void) {
	return &root;
}

void Ball::update(void) {
	return;
}

int Ball::getSize(void) {
	return size;
}

Location Ball::getLocation(void) {
	return loc;
}

bool Ball::canSplit(void) {
	return false;
}

bool Ball::deleteMe(void) {
	return deleteThis;
}

std::list<WorldObject *> Ball::split() {
	return std::list<WorldObject *>();
}

bool Ball::draw(void) {
	return drawMe;
}

void Ball::setDraw(bool d) {
	drawMe = d;
}

void Ball::setDelete(bool d) {
	deleteThis = d;
}